<%--
 *  File:    PrivListDetailJump.jsp
 *  @Author: Langerwang 
 *  Date:    2001/11/29
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.OvalLabel" %>
<%@ page import="com.oval.util.OvalCustomColumn" %>
<%@ page import="com.oval.util.OvalCustomMessage" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.PrivListDetailJump"); 
%>

<%
  String strModuleName = "UPM";
  String privilegeCode = "Z0201";
  String strTableName = "ovprivilege";
%>



<%
  //get privlistid
  String strPrivListId = (String)request.getParameter("privlistid");
%>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<script>
<%if(strPrivListId == null){%>
  opener.refreshWindow();
  window.close();
<%}%>
</script>
<title>PrivListDetailJump</title>
<PageFlow:CheckPageFlow pageName="privlistdetailjump"/>
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<script language="JavaScript" src="../../css/<%= strLanguageCode %>/script.js">
</script>
<%@ include file="/inc/SummaryDivision.inc" %>
<%--------------------------------------  output variant from pageflow   --%>
<%
  Vector allprivilege = (Vector)pageContext.getAttribute("allprivilege");
  if(allprivilege == null)
  {
    allprivilege = new Vector();
  }
  cat.debug("The allprivilege is :" + allprivilege);

  cat.debug("The strCurSearchName is :" + strCurSearchName);
  cat.debug("The strCurSearchValue is :" + strCurSearchValue);  
  cat.debug("The strCurOrderByCol is :" + strCurOrderByCol);
  cat.debug("The strCurOrderByType is :" + strCurOrderByType);
  cat.debug("The nCurMaxItem is :" + nCurMaxItem);  
  cat.debug("The nCurCount is :" + nCurCount);  
  cat.debug("The nCurPageNo is :" + nCurPageNo);
  cat.debug("The nCurTotalPage is :" + nCurTotalPage);
  cat.debug("The nCurEndIndex is :" + nCurEndIndex);
  cat.debug("The bCurHasPre is :" + bCurHasPre);
  cat.debug("The bCurHasNext is :" + bCurHasNext);
          
%>
<script>
function page_add()
{
  <%--[SCRIPT]  alert(nullChecked(document.privlistdetailform.privilegeids,document.privlistdetailform.rowcount.value));  [SCRIPT]--%>
  if(nullChecked(document.privlistdetailform.privilegeids,document.privlistdetailform.rowcount.value))
  {
    alert("<%= message.getMessageDesc("MUST_SELECT_ONE_RECORD_TO_ADD") %>");
    return;
  }
  privlistdetailform.actionname.value = "add";
  isRunning = true;
  privlistdetailform.submit();
  
}
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(privlistdetailform,actionvalue,orderbyname);
  editform.action = "PrivListDetailJump.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();  
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" cellspacing="0" cellpadding="0" height="100%">
  <form name="privlistdetailform" method="post" action="../../Dispatcher">
   <input type="hidden" name="pagename" value="privlistdetailjump">
   <input type="hidden" name="actionname"> 
   <input type="hidden" name="privlistid" value="<%=JspHelper.filterNull( strPrivListId )%>">
   <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
    
 
   <tr> 
      <td valign="top"> 
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr> 
            <td colspan="2" class="summary_top"></td>
          </tr>
          <%@ include file="/inc/SummarySearch.inc" %>
        </table>
        <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
          <%--------------------------------------  summary header   --%>
          <tr> 
            <td width="22" class="deepblue-left">&nbsp;</td>
            <td width="80" class="deepblue-left">&nbsp;<a href="javascript:page_summary('orderby','privilegecode')"><%= "&nbsp;" + label.getLabelName("L_PrivilegeCode") %></td>
            <td class="deepblue-left">&nbsp;<a href="javascript:page_summary('orderby','privilegename')"><%= "&nbsp;" + label.getLabelName("L_PrivilegeName") %></td>
            <td width="60" class="deepblue-left">&nbsp;<a href="javascript:page_summary('orderby','privilegetype')"><%= "&nbsp;" + label.getLabelName("L_PrivilegeType") %></td>      
            <td width="50" class="deepblue-left">&nbsp;<a href="javascript:page_summary('orderby','app')"><%= "&nbsp;" + label.getLabelName("L_AppModuleCode") %></td>                  
          </tr>
          <%
             int i = 0;
             String strClassType = new String();             
          %>
          <logic:iterate id="privilege" collection="<%= allprivilege %>">                      
           
          <%
            HashMap privilegeMap = (HashMap)pageContext.getAttribute("privilege");             
            if(i%2 == 1){
              strClassType = "td-listrom";             
            }else{                    
              strClassType = "";
            }
            i++;     
          %>
             <tr onmouseover="this.className='tr-over'" onmouseout="this.className='<%=JspHelper.filterNull(strClassType)%>'"  class="<%=JspHelper.filterNull(strClassType)%>">
          
            <td width="22" ><input type="checkbox" name="privilegeids" value=<%=JspHelper.filterNull( privilegeMap.get("privilegeid") )%> class="normalradio"></td>
            <td  >&nbsp;<%=JspHelper.filterNull( privilegeMap.get("privilegecode") )%></td>
            <td >&nbsp;<%=JspHelper.filterNull( privilegeMap.get("privilegename") )%></td>
            <td >&nbsp;<%=JspHelper.filterNull( privilegeMap.get("privilegetype") )%></td>
            <td >&nbsp;<%=JspHelper.filterNull( privilegeMap.get("app") )%></td>
         </tr>
          </logic:iterate>  
         <%--------------------------------------  flipping page   --%>
    		 <%@ include file="/inc/SummaryActionPop.inc" %>
        </table>
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="summary_top"></td>
          </tr>
          <tr> 
            <td class="td_center">
                <a onclick="allChecked(privlistdetailform)"><custom:button type="1" label="L_Saveall" imgsrc="saveall.gif" border="0" style="width:60"/></a>
                <a onclick="allCancel(privlistdetailform)"><custom:button type="1" label="L_Resetmarks" imgsrc="resetmarks.gif" border="0"/></a>
                <a onclick="page_add()"><custom:button type="1" label="L_Add" imgsrc="add.gif" border="0" style="width:60"/></a>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </form>
</table>
</body>
</html>


